function simpleBox(simpleBox, title, content, simpleContenuClass) {
	// SIMPLE BOX
	
	var head =	'<div class="simplePopup">' +
	    		'	<div class="simpleTitre">'+
				'		<a href="#" class="simpleClose"><span class="ico"></span>Fermer</a>';
				
	
	if (title != null) {
	    head +=	'		<h2>'+title+'</h2>';
	}

	    head +=	'	</div>' +
	    		'	<div class="simpleContenu'; if (simpleContenuClass != null && simpleContenuClass != '') { head += ' '+simpleContenuClass;} head += '">';
	    head +=		    content+
				'	</div>'+
				'</div>'+
				'<div class="simpleMasque"></div>';
	
	simpleBox.addClass('simpleBox');
	simpleBox.html(head);
	
	openSimpleBox(simpleBox);
}

function openSimpleBox(simpleBox) {
	var simpleClose = $('.simpleClose,.simpleMasque,.inputClose');
	simpleBox.addClass("open");
		
	var simplePop = simpleBox.find(".simplePopup"),
	simpleCont = simpleBox.find(".simpleContenu"),
	simpleTitre = simpleBox.find(".simpleTitre"),
	simpleValid = simpleBox.find(".simpleValid"),
	widthPos = simpleCont.outerWidth() / 2,
	heightPos = (simpleCont.outerHeight() + simpleTitre.outerHeight() + simpleValid.outerHeight()) / 2;

	simplePop.css({
		'width': simpleCont.outerWidth() + 'px',
		'margin-left': '-' + widthPos + 'px',
		'margin-top': '-' + heightPos + 'px'
	});
	
	if(simplePop.outerWidth() > 799){
		var popWidth = 728;
		simplePop.css({'width': popWidth + 'px','margin-left':'-' + popWidth / 2 + 'px'});
	}
	
	if((simplePop.outerHeight() + simpleTitre.outerHeight() + simpleValid.outerHeight()) > 599){
		var popHeight = 540, contHeight = popHeight - simpleTitre.outerHeight() - simpleValid.outerHeight();
		simpleCont.css({'height': contHeight + 'px'}).addClass("scroll");
		simpleCont.children(':last-child').addClass("dern");
		simplePop.css({'height': popHeight + 'px','margin-top':'-' + popHeight / 2 + 'px'});
	}

	simpleClose.click(function(){
		simpleBox.removeClass("open");
		return false;
	});
	
	return false;
}

function changeSimpleBoxContent(simpleBox, content) {
	simpleBox.find('.simpleContenu').html(content);
}